#include "drawer.h"

#include <QGroupBox>
#include <QVBoxLayout>

Drawer::Drawer(QWidget *parent) :QToolBox(parent){
    setWindowTitle(tr("测试聊天系统"));
    setWindowIcon(QPixmap("images/0004.png"));


    QGroupBox *group = new QGroupBox;
    QVBoxLayout * layout = new QVBoxLayout(group);
    layout->setContentsMargins(20,20,20,20);
    layout->setAlignment(Qt::AlignLeft);
    layout->addStretch();

    char itemName[64];

    toolButtons=new QToolButton[20];

   // for(int i=0;i<20;i++){

        sprintf_s(itemName,"admin%02d",1);
        QToolButton *tb = new QToolButton;
        tb->setText(itemName);
        tb->setAutoRaise(true);
        layout->addWidget(tb);

        connect(tb,SIGNAL(clicked()),this,SLOT(showChatWidget()));
   // }



    this->addItem((QWidget*)group,tr("成员"));
}


void showChatWidget(){

    Widget chatWidget = new Widget(0,"txt");
    chatWidget.setWindowTitle("111111");
    chatWidget.show();

}
